NVM.Vivus = (function () {
    var __core = NOVEM.Core;
    var __base = NOVEM.Base;
    var __modules = NOVEM.Modules;

    return {
        init: function (selector) {
            if (__core.getSelector(selector, false, false).length < 1) {
                return true;
            }

            __core.loadJS({
                file: "plugins/vivus.js",
                id: "nvm-vivus-js",
                jsFolder: true,
            });

            __core.isFuncTrue(function () {
                return typeof Vivus !== "undefined";
            }).then(function (cond) {
                if (!cond) {
                    return false;
                }
                __core.initFunction({ class: 'has-plugin-vivus', event: 'pluginVivusReady' });

                selector = __core.getSelector(selector, false);
                if (selector.length < 1) {
                    return true;
                }

                selector[0].querySelectorAll('.col .data-icon svg').forEach(function (element) {
                    element.parentNode.parentNode.addEventListener("mouseenter", (e) => {
                        new Vivus(element, { type: 'sync', duration: 100 }).reset().play();
                    })
                })
            })
        },
    };
})();